#ifndef STAGESTEP_H
#define STAGESTEP_H

#include <cmath>

#include <QWidget>
#include <QDoubleValidator>
#include <QPainter>
#include <QVBoxLayout>
#include <QDebug>

namespace Ui {
class StageStep;
}

class StageStep : public QWidget
{
    Q_OBJECT

public:
    Ui::StageStep *ui;
    explicit StageStep(QWidget *parent = nullptr);
    ~StageStep();

    bool eventFilter(QObject *, QEvent *);

signals:
    void stepShow();

public slots:
    void paint();
    void updatePaint(int);
    void leftUpdatePaint(int);

protected:
    void enterEvent(QEvent* event) override;
    void leaveEvent(QEvent* event) override;
    void resizeEvent(QResizeEvent *event) override;
    void showEvent(QShowEvent *event) override;

public:
    /* 常量定义和初始化 */
    const double SLIDER_HANDLER_HEIGHT = 17.5; // 滑块高度
    const double SLIDER_INIT_HEIGHT = 7; // 滑动条初始值液面高度
    const int INIT_BAR_HEIGHT = 311; // 初始滑动条高度

    bool marked = false;
    QRect runningTimeRect   ;
    QRect finalTempRect     ;
    QRect raiseTempSpeedRect;
    QRect dataCollectionRect;
    int runningTimeRectY;
    int finalTempRectY;
    int raiseTempSpeedRectY;
    int dataCollectionRectY;
    int showCount;
    double leftY;
    double rightY;
    double initY;
    double finalTemp;
    double rightYDelta;

};

#endif // STAGESTEP_H
